<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>helloworld</title>
    <link href="http://libs.baidu.com/fontawesome/4.0.3/css/font-awesome.css" rel="stylesheet">
	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>
<body>
	<div class="myscroll"></div>
	<script type="text/javascript">
		//定义插件  显示图标
        var opt = {
                   "position": "fixed",
                   "bottom": "10px",
                   "right": "50px",
                   "z-index": "1030",
                   "cursor": "pointer",
                   "display": "block"
        };
		$.fn.myPlugin = function() {
			this.css(opt)
            .attr('title', '回到顶部')
            .html('<i class="fa fa-angle-double-up fa-3x"></i>')
		}

		$(".myscroll").myPlugin();//初始化
	</script>
</body>